const path = require("path");
const webpack = require("webpack");
module.exports = {
  mode: "development", // 开发模式
  entry: "./src/index.ts",
  optimization: {
    minimize: false,
    namedModules: true,
  },
  output: {
    path: path.resolve(__dirname, "./lib/"),
    filename: "index.js",
    libraryTarget: "umd",
    library: "ImageCombiner",
    umdNamedDefine: true,
  },
  resolve: {
    extensions: [".ts", ".tsx", ".js"],
  },
  devtool: "source-map",
  module: {
    rules: [
      {
        test: /\.(js|jsx|ts|tsx)$/,
        loader: "babel-loader",
        exclude: /node_modules/,
      },
      {
        test: /\.ts$/,
        loader: "ts-loader",
        exclude: /node_modules/,
        options: {
          instance: "ImageCombiner",
        },
      },
    ],
  },
};
